Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
=====
Fork from supershabam/ready
NodeJS mixin to add one-time ready event
Using ready
or ready.mixin
to add ready
method to the given object.
const ready = require('get-ready');
const obj = {};
ready.mixin(obj);
// register a callback
obj.ready(() => console.log('ready'));
// mark ready
obj.ready(true);
Register a callback to the callback stack, it will be called when mark as ready, see example above.
If the callback is undefined, register will return a promise.
obj.ready().then(() => console.log('ready'));
obj.ready(true);
If it has been ready, the callback will be called immediately.
// already ready
obj.ready(true);
obj.ready().then(() => console.log('ready'));
Warning: the callback is called after nextTick
Mark it as ready, you can simply using .ready(true)
.
You can also mark it not ready.
obj.ready(true);
// call immediately
obj.ready(() => console.log('ready'));
obj.ready(false);
obj.ready(() => throw 'don\'t run');
When exception throws, you can pass an error object, then the callback will receive it as the first argument.
obj.ready(err => console.log(err));
obj.ready(new Error('err'));
3.0.0 (2023-06-05)
https://github.com/eggjs/egg-core/issues/264
FAQs
mixin to add one-time ready event callback handler
We found that get-ready demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.